import Mock from 'mockjs'
import { MockParams } from './types'
import api from './api'
import meunApi from "./meun"
import dictList from "./dictList"
import userList from "./user"
import permission from "./permission"

// 需要遍历的请求
const mocks = [...api, ...meunApi, ...dictList, ...userList,...permission]
// 设置200-2000毫秒延时请求数据
Mock.setup({
  timeout: '200-2000'
})

// 接口拦截
let i: MockParams
for (i of mocks) {
  Mock.mock(new RegExp(i.url), i.type || 'get', i.response)
}